package com.karaoke.oksrv.service

import com.karaoke.oksrv.domain.DataDictionary
import com.karaoke.oksrv.mapper.master.DataDictionaryMapper
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Service

/**
 * Created by allen on 2017/4/26.
 */
@Service
class DataDictionaryService
{
    fun getLanguages(): List<DataDictionary>
    {
        val list = dataDictionaryMapper.selectLanguages()
        return list
    }

    fun getArts(): List<DataDictionary>
    {
        return dataDictionaryMapper.selectArts()
    }

    fun getDatas(): List<DataDictionary>
    {
        return dataDictionaryMapper.selectAll()
    }

    fun getDictByPid(pId: Int): List<DataDictionary>
    {
        return dataDictionaryMapper.selectByPid(pId)
    }

    @Autowired lateinit var dataDictionaryMapper: DataDictionaryMapper
    fun findOne(id: Int): DataDictionary
    {
        return dataDictionaryMapper.selectByPrimaryKey(id)
    }

    fun getSingerTypes(): List<DataDictionary>
    {
        return dataDictionaryMapper.selectSingerTypes()
    }
}
